﻿<UserControl x:Class="CornerstoneRemoteControlClient.Views.ModifySamplesCommandView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:views="clr-namespace:CornerstoneRemoteControlClient.Views"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <Grid>
        <Rectangle StrokeThickness="0.5" Stroke="Black"/>

        <StackPanel Margin="10">

            <views:CommandNameView DataContext="{Binding}" Margin="0,0,0,5"/>

            <StackPanel Margin="0,15,0,5" Orientation="Horizontal">
                <TextBlock Text="Parameters:" Style="{StaticResource HeaderText16}" VerticalAlignment="Center"/>
                <Button Width="80" Height="20" Style="{StaticResource CircleButton}" Margin="10,0" Command="{Binding AddSetCommand}">
                    <Button.Content>
                        <TextBlock Text="+ Set" FontWeight="Bold" FontSize="14" Margin="0,-2,0,0"/>
                    </Button.Content>
                </Button>
                <Button Width="80" Height="20" Style="{StaticResource CircleButton}" Margin="10,0" Command="{Binding AddReplicateCommand}">
                    <Button.Content>
                        <TextBlock Text="+ Rep" FontWeight="Bold" FontSize="14" Margin="0,-2,0,0"/>
                    </Button.Content>
                </Button>
            </StackPanel>

            <Grid>
                <Rectangle StrokeThickness="0.5" Stroke="Black" Visibility="{Binding HasItems, Converter={StaticResource BoolToVisibility}}"/>
                <ScrollViewer VerticalScrollBarVisibility="Auto" MaxHeight="400" Margin="2">
                    <ItemsControl ItemsSource="{Binding SetsAndReps.ObservableCollection}">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <views:DeletableParameterWithFieldsView/>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </ScrollViewer>
            </Grid>

            <views:CommandSyntaxView Margin="0,10,0,5" DataContext="{Binding}"/>
        </StackPanel>
    </Grid>
</UserControl>
